<?php

declare(strict_types=1);

namespace App\CustHub\Constants;

use App\Common\Constants\AbstractBaseConstants;
use Hyperf\Constants\Annotation\Constants;
use phpDocumentor\Reflection\Types\Self_;

#[Constants]
class SendConfigConstants extends AbstractBaseConstants
{
    /**
     * @Message("高级群发")
     */
    public const HIGH_SENDING = 1;

    /**
     * @Message("极速群发")
     */
    public const SPEED_SENDING = 2;

    /**
     * @Message("SOP")
     */
    public const SOP = 3;

    /**
     * @Message("智能自动推送")
     */
    public const SMART_AUTO_PUSH = 4;

    /**
     * @Message("群发-循环任务")
     */
    public const SENDING_LOOP = 5;


    /**
     * @Message("批量群邀请")
     */
    public const BRANCH_INVITE = 6;

    /**
     * @Message("入群欢迎语")
     */
    public const ROOM_WELCOME = 7;

    /**
     * @Message("智能推送")
     */
    public const SMART_PUSH = 8;

    /**
     * @Message("关键词拉群")
     */
    public const ROOM_KEYWORD = 9;

    /**
     * @Message("新客户运营")
     */
    public const NEW_CUSTOMER = 10;

    /**
     * @Message("智能应答")
     */
    public const SMART_ANSWER = 11;

    /**
     * @Message("SOP退订")
     */
    public const SOP_RETURN = 12;

    /**
     * @Message("打招呼")
     */
    public const GREET_SOMEONE = 13;
    /**
     * @Message("渠道活码")
     */
    public const CHANNEL_CODE = 14;



    public static function defaultType(): array
    {
        return [
            self::SMART_AUTO_PUSH => 'smart_auto_push',
            self::HIGH_SENDING => 'send_conf',
            self::SPEED_SENDING => 'send_speed_conf',
            self::SOP => 'sop_send_conf',
            self::ROOM_WELCOME => 'room_welcome',
            self::SMART_PUSH => 'smart_push',
            self::ROOM_KEYWORD => 'room_keyword',
            self::NEW_CUSTOMER => 'new_customer',
            self::BRANCH_INVITE => 'branch_invite',
            self::SMART_ANSWER => 'smart_answer',
            self::GREET_SOMEONE => 'greet_someone',
        ];
    }

    /**
     * 获取默认配置类型
     * @param int $type
     * @return string
     */
    public static function getDefaultType(mixed $type): string
    {
        return self::defaultType()[$type] ?? '';
    }
}